﻿<Window x:Class="Árvore_Binária_de_Pesquisa.BinarySearchTree"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Árvore Binária" Height="700" Width="1000" SizeChanged="grid_SizeChanged" Background="Black" 
        ResizeMode="CanMinimize" MinHeight ="700" MinWidth="1000">

    <Window.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/CommomFunctions;component/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            
            <Style TargetType="{x:Type Line}">
                <Setter Property = "X1" Value="55" />
                <Setter Property = "X2" Value="120" />
                <Setter Property = "Grid.Row" Value="7" />
                <Setter Property = "Grid.Column" Value="3" />
                <Setter Property = "Grid.RowSpan" Value="2" />                
                <Setter Property = "Grid.ColumnSpan" Value="2" />
                <Setter Property = "Stroke" Value="GreenYellow" />
                <Setter Property = "StrokeThickness" Value="4" />
            </Style>
             
        </ResourceDictionary>

    </Window.Resources>
    
    <Grid Name="Gridi" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ShowGridLines="False" Margin="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="40*" />

        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>
        
        <Menu Height="22" Margin="0,0,30,0" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Column="0" Grid.ColumnSpan="2">
           <MenuItem Header="_Opções">
                <MenuItem Header ="Ao remover, substituir raiz por:">
                    <MenuItem Name="removePredecessor" Click="removePredecessor_Click" Header="predecessor"/>
                    <MenuItem Name="removeSuccessor" Click="removeSuccessor_Click"  Header="successor" IsChecked ="True"/>
                </MenuItem>
            </MenuItem>

            <MenuItem Header="Caminhos">
                <MenuItem Header="Direita">
                    <MenuItem Name="preOrderRight" Click="preOrderRight_Click" Header="Pré-Fixado"/>
                    <MenuItem Name="inOrderRight" Click="inOrderRight_Click" Header="Central"/>
                    <MenuItem Name="postOrderRight" Click="postOrderRight_Click" Header="Pós-Fixado"/>
                </MenuItem>
                <MenuItem Header="Esquerda">
                    <MenuItem Name="preOrderLeft" Click="preOrderLeft_Click" Header="Pré-Fixado"/>
                    <MenuItem Name="inOrderLeft" Click="inOrderLeft_Click" Header="Central"/>
                    <MenuItem Name="postOrderLeft" Click="postOrderLeft_Click" Header="Pós-Fixado"/>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="_Ajuda">
                <MenuItem Click="help_Click"  Header="Ajuda Estrutura de Dados"/>
                <MenuItem Click="tutorial_Click" Header="Tutorial"/>
                <MenuItem Click="about_Click" Header="Sobre"/>
            </MenuItem>
        </Menu>

        <GroupBox Header="" Margin ="0, 0, 7, 10" BorderThickness ="0.0" Grid.Row ="7" Grid.RowSpan="2"  Grid.ColumnSpan="3">
            <StackPanel>
                <Button Name="btnComplete"  Margin="35,-5,10,80" MinHeight ="30" MinWidth="100"   HorizontalAlignment="Left" VerticalAlignment ="Center"  Click="btnExhibitComplete_Click">Exibir Completa</Button>
                <Button Name="btnCreate"  Margin="150,-110,10,80" MinHeight ="30" MinWidth="100" HorizontalAlignment="Left" VerticalAlignment ="Center"  Click="btnCreate_Click">Criar Árvore</Button>
                <Button Name="btnDestroy" Margin="150,-70,10,40" MinHeight ="30" MinWidth="100" IsEnabled="False"  HorizontalAlignment="Left" VerticalAlignment ="Center"  Click="btnDestroy_Click">Destruir Árvore</Button>
            </StackPanel>
        </GroupBox>

        <GroupBox Margin ="10, 55, 7, 25" Grid.Row ="6" Grid.RowSpan="3" Grid.Column="4">
            <GroupBox.Header>
                <Label>Operações</Label>
            </GroupBox.Header>            

            <StackPanel>
                <Button Name="btnInsert"  Margin="10,10,10,85" MinHeight ="24" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment ="Center"  Click="btnInsere_Click">Insere</Button>
                <Button Name="btnSearch" Margin="10,-75,10,45" MinHeight ="24" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment ="Center"  Click="btnProcura_Click">Procura</Button>
                <Button Name="btnRemove"  Margin="10,-45,10,5" MinHeight ="24" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment ="Center"  Click="btnRemove_Click">Remove</Button>
            </StackPanel>
        </GroupBox>

        <GroupBox Margin ="70,25,55,65" Grid.Row ="7" Grid.RowSpan="2" Grid.Column="2"  Grid.ColumnSpan="2">
            <GroupBox.Header>
                <Label>Nodo</Label>
            </GroupBox.Header>
            <TextBox Name ="txtInput" Margin="10,0,10,5" VerticalAlignment ="Center"></TextBox>
        </GroupBox>

        <Line Y1="50" Y2="25"/>
        <Line Y1="60" Y2="60"/>
        <Line Y1="70" Y2="95"/>
        
    </Grid>
</Window>
